#include "borrowedbook.h"

BorrowedBook::BorrowedBook() {}

QDate BorrowedBook::getLoanTime() const
{
    return loanTime;
}

void BorrowedBook::setLoanTime(const QDate &newLoanTime)
{
    loanTime = newLoanTime;
}

bool BorrowedBook::getIsChecked() const
{
    return isChecked;
}

void BorrowedBook::setIsChecked(bool newIsChecked)
{
    isChecked = newIsChecked;
}

BorrowedBook::BorrowedBook(const QString &name, const QString &publisher,
                           const QString &author, const QString &ISBN,
                           const QString &category, const QString &collectionLocation,
                           int currentCollection, int allCollection,
                           const QDate&loanTime,QCheckBox*checkBox):Book(name,publisher,author,ISBN,category,
                                                      collectionLocation,currentCollection,
           allCollection),loanTime(loanTime),isChecked(false),checkBox(checkBox)
{
}

bool BorrowedBook::operator<(const BorrowedBook&book){
    return this->loanTime<book.loanTime;
}

QCheckBox *BorrowedBook::getCheckBox() const
{
    if (checkBox == nullptr) {
        qDebug() << "QCheckBox is null!";
    }
    return checkBox;
}

void BorrowedBook::setCheckBox(QCheckBox *newCheckBox)
{
    checkBox = newCheckBox;
}

BorrowedBook::~BorrowedBook() {
    // 析构函数实现
}
